#define _CRT_SECURE_NO_WARNINGS 2

#include<stdio.h>
//upsort
void InsertSort(int* arr, int len) {
	for (int i = 0; i < len - 1; i++) {
		int end = i;
		int tmp = arr[end+1];
		while (end >= 0) {
			if (tmp < arr[end]) {
				arr[end + 1] = arr[end];
				end--;
			}
			else {
				break;
			}
		}
		arr[end + 1] = tmp;
	}
}

int main() {
	int arr[] = { 3,8,7,9,3,5,11,0 };
	int len = sizeof(arr) / sizeof(arr[0]);
	InsertSort(arr, len);

	for (int i = 0; i < len; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}